package com.zzg.srb.core.controller.admin;


import com.zzg.srb.common.result.R;
import com.zzg.srb.core.service.UserLoginRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 用户登录记录表 前端控制器
 * </p>
 *
 * @author zhengzg
 * @since 2022-05-27
 */
@Api(tags = "会员登录日志接口")
@RestController
@RequestMapping("/admin/core/userLoginRecord")
public class AdminUserLoginRecordController {

    private Logger log = LoggerFactory.getLogger(AdminUserLoginRecordController.class);

    @Resource
    private UserLoginRecordService userLoginRecordService;

    @ApiOperation("获取会员登录日志列表")
    @GetMapping("/listTop50/{userId}")
    @ApiImplicitParam(name = "userId",value = "用户id",dataType = "Long",required = true)
    public R listTop50(@PathVariable Long userId){
        log.info("会员登录日志接口 ====> AdminUserLoginRecordController.listTop50" + userId);
        return R.ok().data(userLoginRecordService.listTop50(userId));
    }
}

